import functools


def log(level):
    def decorator(fun):
        @functools.wraps(log)
        def wrapper(*args, **kwargs):
            print(f"{level}:方法调用前")
            result = fun(*args, **kwargs)
            print(f"{level}:方法调用后")
            return result

        return wrapper

    return decorator


@log(level="INFO")
def hello():
    print("Hello,World")


if __name__ == '__main__':
    print(hello.__name__)
